class UrlMappings {
	
	/**
	 * Es defineix les direccions segons la URL
	 * 
	 * URL inicial: comic/list
	 */
    static mappings = {
	  "/"{
		  controller = "comic"
		  action = "list"
	  }
	  
	  "/$offset/max/$max?"{
		controller = "comic"
		  action = "list"
		constraints{
			offset(matches:/\d+/)
			max(matches:/\d*/)

		
		}
	  }
	  
	  
	  "/$controller/$action/$commentToName/$commentToId"{
		constraints{
			commentToName(matches:/\w+/)
			commentToId(matches:/\d+/)
		
		}
	  }
	  
	  "/$controller/$action/$offset/max/$max?"{
		constraints{
			offset(matches:/\d+/)
			max(matches:/\d*/)

		
		}
	  }
	  
	   "/page/list/of/$fromId/$offset?/max/$max?"{
	      controller = "page"
    	  action = "list"
	  
	  }
	  
	   "/alterPage/list/of/$fromId/$offset?/max/$max?"{
	      controller = "page"
    	  action = "list"
	  
	  }
	  
      
      "/$controller/$action?/$id?"{
	      constraints {
			 // apply constraints here
		  }
	  }
      
      "/index"(view:"/index")
      
      "500"(view:'/error')
      
      
	}
}
